package com.itheima_03;

public class Student {
    private String name;
    private int age;
    public void setName(String name) {
        //方法中出现局部变量和成员变量同名称时，用this关键字修饰的变量是成员变量，未加this的变量为局部变量（形参）
        //注意，直接使用name=name无法完成变量赋值
        //name = name;
        this.name = name;
    }
    public String getName () {
        return name;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public int getAge() {
        return age;
    }
    public void show() {
        System.out.println(name + "  " + age);
    }
}
